from lib.Snake_Body.snake_segment import Snake_Segment
from lib.sittings import MOVE_RATE
from lib.sittings import MOVE_THRESHOLD
from lib.sittings import SNAKE_HEAD_COLOR
from lib.sittings import SNAKE_HEAD_RADIUS


class Snake_Head(Snake_Segment):
    def __init__(self, tilepos, movedir, segment_groups):
        Snake_Segment.__init__(self, tilepos, segment_groups, color=SNAKE_HEAD_COLOR, radius=SNAKE_HEAD_RADIUS)
        self.movedir = movedir
        self.movecount = 0

    def update(self):
        self.movecount += MOVE_RATE
        if self.movecount > MOVE_THRESHOLD:
            self.move()
            self.movecount = 0